<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>菜单列表</title>
<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />

<link rel="stylesheet" type="text/css" href="$request.getContextPath()/resources/bootstrap/css/bootstrap.min.css" rel="stylesheet">
<link rel="stylesheet" type="text/css" href="$request.getContextPath()/resources/layui/css/layui.css">
<link rel="stylesheet" href="$request.getContextPath()/resources/bootstrap-table/css/bootstrap-table.min.css">
<link rel="stylesheet" href="$request.getContextPath()/resources/cws/system/permission/list.css" />
</head>
<body>
	<div class="container-fluid">
		<div class="header"></div>
		<div class="searchform">
			<form class="form-horizontal" role="form">
				<div class="form-group">
					<label for="roleType" class="col-sm-1 control-label">菜单</label>
					<div class="col-sm-2">
						<select class="form-control" id="subMenuSelect" placeholder="请输入菜单类型">
						    <option value="">请选择</option>
							#foreach($subMenu in $subMenus)
					        <option value="$subMenu.menuId">$subMenu.menuName</option>
					        #end
						</select>
					</div>
					<label for="roleName" class="col-sm-1 control-label">权限名称</label>
					<div class="col-sm-2">
						<input type="text" class="form-control" name="roleName" value="$!roleName" placeholder="请输入菜单名称">
					</div>
					<div class="col-sm-2">
						<button type="button" onclick="queryPermission()" class="btn btn-default">查询</button>
					</div>
				</div>
			</form>
		</div>
		<div id="toolbar">
			#if($shiro.hasPermission('system:permission:add'))
				<button type="button" class="btn btn-default btn-sm" onclick="addPermission()"><span class="glyphicon glyphicon-plus"></span>添加</button>
			#end
			#if($shiro.hasPermission('system:permission:export'))
			    #if($model.has('sys_permission'))
					<button type="button" class="btn btn-default btn-sm" onclick="exportMenu()"><span class="glyphicon glyphicon-export"></span>导出</button>
			    #end
			#end
			<!--#if($shiro.hasPermission('system:permission:statistics'))
				<button type="button" class="btn btn-default btn-sm" onclick="menuStatistics()"><span class="glyphicon glyphicon-star"></span>统计</button>
			#end-->
		</div>
		<table id="permissionTable" 
		    data-toolbar="#toolbar" 
		    data-show-refresh="true"
			data-search="false" 
			data-show-toggle="true" 
			data-show-columns="true"
			data-show-export="true" 
			data-id-field="id" 
			data-show-export="true"
			data-pagination="true" 
			data-query-params="queryParams"
			data-query-type="limit" 
			data-show-footer="false"
			data-click-to-select="true" 
			data-single-select="false"
			data-striped="true" 
			data-method="get"
			data-url="$request.getContextPath()/system/permission/page"
			data-side-pagination="server" 
			data-page-list="[10, 25, 50, 100, ALL]"
			data-show-pagination-switch="true" 
			data-id-field="userId"
			data-search-on-enter-key="true" 
			data-pagination-v-align="bottom"
			data-show-pagination-switch="true">
		</table>
	</div>
</body>
<script src="$request.getContextPath()/resources/jquery/jquery-3.1.0.min.js"></script>
<script src="$request.getContextPath()/resources/bootstrap/js/bootstrap.min.js"></script>

<script type="text/javascript" src="$request.getContextPath()/resources/layer/layer.js"></script>
<script type="text/javascript" src="$request.getContextPath()/resources/layui/layui.js"></script>
<script type="text/javascript" src="$request.getContextPath()/resources/layui/lay/modules/element.js"></script>

<script type="text/javascript" src="$request.getContextPath()/resources/bootstrap-table/js/bootstrap-table.min.js"></script>
<script type="text/javascript" src="$request.getContextPath()/resources/bootstrap-table/js/bootstrap-table-zh-CN.min.js"></script>
<script type="text/javascript">
	var permissionButtons=[];
	var permissionViewPermission="$shiro.hasPermission('system:permission:view')";
	if(permissionViewPermission&&permissionViewPermission=="true"){
		permissionButtons.push('<button type="button" class="btn btn-default btn-sm permissionDetail"><span class="glyphicon glyphicon-eye-open"></span>查看</button>');
	}
	var permissionEditPermission="$shiro.hasPermission('system:permission:edit')";
	if(permissionEditPermission&&permissionEditPermission=="true"){
		permissionButtons.push('<button type="button" class="btn btn-default btn-sm editPermission"><span class="glyphicon glyphicon-edit"></span>编辑</button>');
	}
	var permissionDeletePermission="$shiro.hasPermission('system:permission:delete')";
	if(permissionDeletePermission&&permissionDeletePermission=="true"){
		permissionButtons.push('<button type="button" class="btn btn-default btn-sm deletePermission"><span class="glyphicon glyphicon-trash"></span>删除</button>');
	}
</script>
<script type="text/javascript" src="$request.getContextPath()/resources/cws/system/permission/list.js"></script>
</html>
#parse("/portal/account/footer2.html")